package com.example.demo1.service;


import com.example.demo1.domain.Student;
import com.example.demo1.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface StudentService {

    List<Student> findAll();

    /**
     * 只支持分页的查询
     * @param pageable
     * @return
     */
    Page<Student> findAll(Pageable pageable);

    Page<Student> findAll(Example<Student> student,Pageable pageable);

    Student insert(Student student);

    Student update(Student student);

    void deleteById(Integer id);

    Student findById(Integer id);
    Student findByNameAndPassword(String name,String password) throws Exception;

}
